<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改防疫队伍')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-team-edit" th:object="${fyTeam}">
            <input name="teamId" th:field="*{teamId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">防疫队伍名称：</label>
                <div class="col-sm-8">
                    <input name="teamName" th:field="*{teamName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">核酸点：</label>
                <div class="col-sm-8">
                    <select name="placeId" id="placeId" class="form-control m-b" th:with="type=${fyPlaces}">
                    	<option value="" >请选择</option>
		                <option th:each="place : ${type}" th:text="${place.placeName}" th:value="${place.placeId}" th:field="*{placeId}"></option>
		            </select>
                </div>
            </div>
            <input id="placeName" name="placeName" th:field="*{placeName}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">负责人名称：</label>
                <div class="col-sm-8">
                    <input name="mgrName" th:field="*{mgrName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">负责人手机号：</label>
                <div class="col-sm-8">
                    <input name="mgrPhone" th:field="*{mgrPhone}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">覆盖人数：</label>
                <div class="col-sm-8">
                    <input name="coverNum" th:field="*{coverNum}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">预估采样单元组数：</label>
                <div class="col-sm-8">
                    <input name="ygcydyzs" th:field="*{ygcydyzs}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">预估采样团队人数：</label>
                <div class="col-sm-8">
                    <input name="ygcytdrs" th:field="*{ygcytdrs}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">检测机构：</label>
                <div class="col-sm-8">
                    <input name="checkOrg" th:field="*{checkOrg}" class="form-control" type="text">
                </div>
            </div>
            <!-- <div class="form-group">    
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('fym_place_status')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div> -->
            <div class="form-group">    
                <label class="col-sm-3 control-label">采样点医务联络员：</label>
                <div class="col-sm-8">
                    <input name="doctorName" th:field="*{doctorName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">采样点医务联络方式：</label>
                <div class="col-sm-8">
                    <input name="doctorPhone" th:field="*{doctorPhone}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "fym/team";
        $("#form-team-edit").validate({
            focusCleanup: true
        });
		//下拉框改变的时候id变化的同时，name也跟着变
        $('#placeId').change(function(){
        	//console.log($("#placeId option:selected").text());
        	$("#placeName").val($("#placeId option:selected").text());
        })
        
        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-team-edit').serialize());
            }
			// 父页面的方法
			activeWindow().timeoutQueryTeamTree(); 
			$.modal.close();
			//setTimeout("initTeamTree",1);
        }
    </script>
</body>
</html>